package com.ygl.strategy.service.sentinel.configuration;

import com.alibaba.csp.sentinel.adapter.servlet.callback.RequestOriginParser;
import com.ygl.strategy.sentinel.constant.SentinelStrategyConstant;
import com.ygl.strategy.service.sentinel.parser.ServiceSentinelRequestOriginParser;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author yanggld
 * @Date 2020/1/10-17:51
 * @Description
 */
@Configuration
@ConditionalOnProperty(value = SentinelStrategyConstant.SPRING_APPLICATION_STRATEGY_SENTINEL_ENABLED, matchIfMissing = false)
public class ServiceSentinelStrategyAutoConfiguration {

	@Bean
	public RequestOriginParser serviceSentinelRequestOriginParser() {
		return new ServiceSentinelRequestOriginParser();
	}
}
